// Scroller.h: interface for the Scroller class.
//
//////////////////////////////////////////////////////////////////////

//23-11-2000 jd	data grid development

#if !defined(AFX_SCROLLER_H__3D8D0676_A488_11D2_A452_006097A44215__INCLUDED_)
#define AFX_SCROLLER_H__3D8D0676_A488_11D2_A452_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

//#include "ScrollerLayout.h"
class ScrollerLayout;

class CLASS_DECL_D Scroller : public AWTPanel,
                              public AWTAdjustmentListener  
{
DECLARE_DYNAMIC(Scroller)
public:
	Scroller();
	virtual ~Scroller();

	virtual void scrollTo(int x, int y) = 0;
	virtual CSize getScrollAreaSize() = 0;

  AWTScrollbar* getHorizontalScrollbar() 
		{return m_hbar;}
  AWTScrollbar* getVerticalScrollbar() 
		{return m_vbar;}
  AWTPanel* getViewport() 
		{return m_viewport;}

	void adjustmentValueChanged(AWTAdjustmentEvent* event);
  void paint(CDC* dc) 
		{scroll();}
  void update(CDC* dc) 
		{paint(dc);}
	void manageScrollbars();
	void setScrollPosition(int x, int y);
  void setScrollbarValues();
	
	//////////////////////
	//jd 21-11-2000
	int getHScrollPosition()
		{return m_hbar->getValue();}
	int getVScrollPosition()
		{return m_vbar->getValue();}
	//jd end
	//////////////////////

protected:
	void manageHorizontalScrollbar();
  void manageVerticalScrollbar();
  virtual void setHorizontalScrollbarValues();
	virtual void setVerticalScrollbarValues();
  void scrollLineUp  () { scroll(); }
  void scrollLineDown() { scroll(); }
  void scrollPageUp  () { scroll(); }
  void scrollPageDown() { scroll(); }
  void scrollAbsolute() { scroll(); }
	void setHorizontalLineAndPageIncrements();
  void setVerticalLineAndPageIncrements();
	void scroll() 
		{scrollTo(m_hbar->getValue(), m_vbar->getValue());}

	AWTPanel* m_viewport;
	AWTScrollbar* m_hbar;
	AWTScrollbar* m_vbar;
	BOOL m_bTrack;
};

#endif // !defined(AFX_SCROLLER_H__3D8D0676_A488_11D2_A452_006097A44215__INCLUDED_)
